home *** CD-ROM | disk | FTP | other *** search
- CUSTOM.COM - Customizes Plain Vanilla Progams
- Not Copyrighted
-
- 1. For Users
-
- This utility allows you to customize many other Plain Vanilla programs
- if you receive them in a configuration that is not suitable for your
- uses. You can also use it to customize your own programs if you have
- written them with that in mind. A program can be customized as many
- times and in as many ways as you wish. However, if you use several
- different versions of one program, you will have to use the RENAME
- feature of DOS to change their names.
-
- To customize a progam, first read the documentation for that program to
- determine whether it can be customized, and whether the features that
- you want to change can be changed in this manner. This is very
- important, since CUSTOM.COM does not provide any help facilities.
-
- Each customizable program contains one or more parameters, such as
- column widths, key codes, or other numbers that describe the required
- characteristics of the program and are used by the program to operate in
- the desired manner. The CUSTOM.COM utility finds these parameters and
- changes them to the values you specify.
-
- Make sure you have at least one other working copy of the program before
- attempting to customize a copy, since an equipment or power failure
- during customization may damage or erase the program. (Operator error,
- however, usually leads to a nonworking version of the program that can
- be customized again to produce a working version.) Also, the new
- version will be written right over the old version and will replace it,
- at least in the current directory.
-
- Now make sure CUSTOM.COM is in the current directory or is accessible
- through the PATH directive, and that the program to be customized is
- accessible. Then type
-
- CUSTOM <file specifications of program>
-
- When typing the file specifications of the program, you must include the
- extension (usually .COM), since no default extension will be supplied.
- You may include a drive specification if the program is not on the
- currently logged drive, and you may include a directory path if the
- program is not in the current directory.
-
- The CUSTOM.COM utility then displays the name and current value of each
- parameter and prompts you for a new value. Each parameter is an integer
- in the range from 0 to 65535 (although meaningful values are usually in
- much more restricted ranges). You will usually have to refer to the
- documentation to determine the desired value of each parameter, because
- the parameter names themselves convey very little information.
-
- If the current value of a parameter is not to be changed, just strike
- the "enter" key without entering anything. Otherwise, enter the
- appropriate integer. You can use the backspace and other keys to
- correct your mistakes, just as you can when entering a command line for
- DOS. When you are satisfied with the value you have entered, strike the
- "enter" key.
-
- If you strike the "Ctrl-C" key combination at any time before entering
- the last parameter, the customization will be aborted. The utility will
- usually not be usable, so you should be revert to your backup copy in
- this case.
-
- If you should notice an error in the value you entered for a parameter,
- you cannot correct the error once you have struck the "enter" key. But
- all is not lost. A program with an incorrect parameter will not work as
- desired, and if the error is serious enough, if may not work at all, but
- it can be customized again. Just continue with the customization and
- then start over. Keep pressing the "enter" key until the erroneous
- parameter comes up. Then enter the correct value, and continue pressing
- the "enter" key until no further parameters come up.
-
- If you plan to use the new version of the program along with the old
- version, use the RENAME function of DOS to change the name of the new
- version. Leave the extension unchanged so the program will load
- properly.
-
- 2. For Programmers
-
- Writing a customizable program is fairly simple, at least in assembly
- language or C. Customization parameters must appear in one or more
- customization blocks, consisting of the following bytes:
-
- (1) The six identification bytes 17H, FDH, 46H, 0FH, 74H and B3H,
- in precisely that order. The CUSTOM.COM scans the object code
- for these six bytes, so the customization block may appear
- anywhere in the object code. These six bytes must NOT appear
- together in this order anywhere in the object code except at
- the beginning of a customization block. They were chosen
- years ago with the help of a random number table, and are
- extremely unlikely to appear elsewhere by coincidence.
-
- (2) One or more parameter blocks, consisting of
-
- (a) The name of the parameter, as it is to be displayed
- by the customization program, as a C-style ASCII
- string terminated by a zero byte (an ASCII NUL). Do
- not include brackets or a colon. These will be
- supplied by the CUSTOM.COM utility. The name must
- contain at least one character other than the
- terminating zero byte. Most programs will be
- slightly more efficient if the name consists of an
- even number of ASCII characters (including the
- terminating zero byte), since this will put the
- parameter value on a word boundary.
-
- (b) The two-byte parameter value, stored in the usual
- manner, with the less significant byte first (at the
- lower address). The value in the source code should
- the the default value of the parameter in the
- distributed program. It will be changed as required
- by the CUSTOM.COM utility.
-
- (3) A single zero byte to terminate the customization block.
-
- Here is a specimen customization block from a Plain Vanilla utility:
-
- static char id[] = {0x17,0xFD,0x46,0x0F,0x74,0xB3};
- static char par1[] = "Lines on page ";
- static int lines_on_page = 56;
- static char par2[] = "Line width ";
- static int line_width = 72;
- static char par3[] = "Top margin ";
- static int top_margin = 5;
- static char par4[] = "Left margin ";
- static int left_margin = 5;
- static char par5[] = "LPT (1, 2 or 3) ";
- static int LPT = 1;
- static char par6[] = "Spacing (1 or 2) ";
- static int spacing = 1;
- static char par7[] = "Pause (1=Y, 0=N) ";
- static int pause_flag = 0;
- static char parx = 0;
-
- Here all parameter names have been padded with spaces to the same
- length, which is deliberately made odd so all the parameter values will
- fall on word boundaries. Every parameter is explicitly initialized,
- even if the default value is 0. This is required by most C compilers to
- keep the entire block in the same memory segment. The variable names
- id, par1, par2, ..., par7 and parx are arbitrary.
-
- Here is the same customization block in assembly language:
-
- DB 17H, 0FDH, 46H, 0FH, 74H, 0B3H
- DB "Lines on page ", 0
- LINES_ON_PAGE DW 56
- DB "Line width ", 0
- LINE_WIDTH DW 72
- DB "Top margin ", 0
- TOP_MARGIN DW 5
- DB "Left margin ", 0
- LEFT_MARGIN DW 5
- DB "LPT (1, 2 or 3) ", 0
- LPT DW 1
- DB "Spacing (1 or 2) ", 0
- SPACING DW 1
- DB "Pause (1=Y, 0=N) ", 0
- PAUSE_FLAG DW 0
- DB 0
-
- Notice that the terminating zero byte at the end of each parameter name
- is not supplied automatically, as it would be in C. It must be
- specified explicitly.
-
- Writing a customizable program in other languages is a little more
- difficult, but it can usually be done. You just have to create a
- customization block that will have the required layout in the object
- code with 16-bit parameter values accessible to the rest of the program.
- For example, here is the same customization block in Turbo Pascal 5.0:
-
- id : array[1..6] of byte = ($17,$FD,$46,$0F,$74,$B3);
- par1 : array[1..18] of char = 'Lines on page '#0;
- lines_on_page : word = 56;
- par2 : array[1..18] of char = 'Line width '#0;
- line_width : word = 72;
- par3 : array[1..18] of char = 'Top margin '#0;
- top_margin : word = 5;
- par4 : array[1..18] of char = 'Left margin '#0;
- left_margin : word = 5;
- par5 : array[1..18] of char = 'LPT (1, 2 or 3) '#0;
- LPT : word = 1;
- par6 : array[1..18] of char = 'Spacing (1 or 2) '#0;
- spacing : word = 1;
- par7 : array[1..18] of char = 'Pause (1=Y, 0=N) '#0;
- pause_flag : word = 0;
- parx : byte = 0;
-
- The block should be put into the constant declaration part of the main
- program. Notice that in Pascal the terminating zero byte at the end of
- each parameter name is not supplied automatically, as it would be in C.
- It must be specified explicitly.
-
- It is permissible to use more than a single customization block in a
- program, provided each one follows this form. The CUSTOM.COM utility
- should be able to find all of them.
-
-
- 3. No Copyright
-
- Unlike most other Plain Vanilla software, the CUSTOM.COM utility and
- this documentation file are not copyrighted, at least in their latest
- versions. You may use them and distribute them with your own programs,
- even if you are selling them.
-
- The source code file CUSTOM.ASM, which is also uncopyrighted, is being
- distrubuted along with the object and documentation files.
-
- Plain Vanilla Corporation 9-1-89
- P.O. Box 4493, San Diego CA 92164
-